    <link rel="stylesheet" href="<?= $this->config->item('webroot') ?>styles/requisitions.css" type="text/css" />

	<!-- Page title -->
	<div id="pagetitle">
		<div class="wrapper">
			<h1>Requisitions</h1>
			<form action="" method="get"><input class="" type="text" id="q" name="q" /></form>
		</div>
	</div>
	<!-- End of Page title -->
	
	<!-- Page content -->
	<div id="page">
    	
		<!-- Wrapper -->
		<div class="wrapper">

			<div class="column width2 first">

			    <!-- links box -->
			    <div class="overview content-box corners">
				<header>
				    <h3><img src="<?= $this->config->item('webroot') ?>images/icons/information.png" alt="" />Dashboard</h3>
				</header>
				<section class="width-95pc">

					<ul>
						<li><a href="#" id="for-po-creation">For PO Creation</a></li>
						<li><a href="#" id="active-requisitions">Active Requisitions</a></li>
						<li><a href="#" id="search">Search</a></li>
					</ul>

					<fieldset>
						<legend>Reports</legend>
						<ul>
							<li><a href="#" id="total-requisitions">Total Requisitions</a></li>
							<li><a href="#" id="top-suppliers">Top Suppliers</a></li>
						</ul>
					</fieldset>

				</section>
			    </div>

			</div>



			<div class="jobs column width6">

			<!-- main content box -->
			    <div id="main-content-box" class="job content-box corners">
				<header>
				    <h3><img src="<?= $this->config->item('webroot') ?>images/icons/information.png" alt="" /><span id="main-content-box-title">For PO Creation</h3>
				</header>
				<section class="width-95pc">
					<div id="main-content1">




						<table id="report" class="stylized full" style="">
							<thead>
								<tr>

									<th>Requisition #</th>
									<th>Date</th>
									<th>Materials</th>
								</tr>
							</thead>
							<tbody>
								<tr>

									<td class="title">
										<div>
											<a href="re"><b>89273</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 30, 2011<br />
													<b>Status:</b> Approved by Juan Dela Cruz (Department Manager)
													<ul>
														<li>1 bottle Chlorine</li>
														<li>5 reams bondpaper (A4)</li>
														<li>2 boxes Paper Clips</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>2 days ago (May 3)</td>
									<td><a href="<?= base_url() ?>requisitions/approval_purchasing">1 bottle Chlorine, 5 reams bondpaper (A4), 2 boxes Paper Clips</a></td>

								</tr>
								<tr>

									<td class="title">
										<div>
											<a href="re"><b>12335</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 30, 2011<br />
													<b>Status:</b> Approved by Juan Dela Cruz (Department Manager)
													<ul>
														<li>1 pc T-shirt (green)</li>
														<li>1 pc Clear Folder (short)</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>5 days ago (April 30)</td>
									<td><a href="<?= base_url() ?>requisitions/approval_purchasing">1 pc T-shirt (green), 1 pc Clear Folder (short)</a></td>

								</tr>
								<tr>

									<td class="title">
										<div>
											<a href="re"><b>64563</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals</li>
														<li>1pc Extension wire</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>8 days ago (April 27)</td>
									<td><a href="<?= base_url() ?>requisitions/approval_purchasing">100 pairs Sandals, 1 pc Extension wire</a></td>

								</tr>
								<tr>

									<td class="title">
										<div>
											<a href="re"><b>97432</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
														<li>Received by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals</li>
														<li>1pc Extension wire</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>9 months ago (July 2010)</td>
									<td><a href="<?= base_url() ?>requisitions/approval_purchasing">Caustic Soda</a></td>

								</tr>
								<tr>
									<td colspan="3"><a href="#">+ More</a></td>
								</tr>
							</tbody>
						</table>

					</div>


					<div id="main-content2" class="hidden">

						Filter:
						<select>
							<option>May</option>
						</select>
						<select>
							<option>2011</option>
						</select>
						<select>
							<option></option>
							<optgroup label="Status">
								<option>Department Manager</option>
								<option>Canvasser</option>
								<option>Purchasing Manager</option>
								<option>Received</option>
							</optgroup>
						</select>
						<input type="text" value="Search..." onclick="this.value=''">

						<table id="report" class="stylized full" style="">
							<thead>
								<tr>

									<th>Requisition #</th>
									<th>Date</th>
									<th>Materials</th>
									<th>Encoder</th>
									<th>Department<br />Manager</th>
									<th>Canvasser</th>
									<th>Purchasing<br />Manager</th>
									<th>Received</th>
									<th>Est.<br />Arrival</th>
								</tr>
							</thead>
							<tbody>
								<tr class="hideable-requisition">

									<td>89273</td>
									<td>2 days ago (May 3)</td>
									<td><a href="<?= base_url() ?>requisitions/new_requisition">1 bottle Chlorine, 5 reams bondpaper (A4), 2 boxes Paper Clips</a></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>12335</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 30, 2011<br />
													<b>Status:</b> Approved by Juan Dela Cruz (Department Manager)
													<ul>
														<li>1 pc T-shirt (green)</li>
														<li>1 pc Clear Folder (short)</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>5 days ago (April 30)</td>
									<td>1 pc T-shirt (green), 1 pc Clear Folder (short)</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
									<td class="ta-center">2 days from now</td>
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>64563</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals: <a href="#">PO# 123</a></li>
														<li>1pc Extension wire: <a href="#">PO# 456</a></li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>8 days ago (April 27)</td>
									<td>100 pairs Sandals, 1 pc Extension wire</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
									<td class="ta-center">3 days from now</td>
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>97432</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
														<li>Received by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals: <a href="#">PO# 123</a></li>
														<li>1pc Extension wire: <a href="#">PO# 456</a></li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>9 months ago (July 2010)</td>
									<td>Caustic Soda</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
								</tr>
								<tr class="hidden">

									<td>89273</td>
									<td>2 days ago (May 3)</td>
									<td><a href="<?= base_url() ?>requisitions/new_requisition">1 bottle <span style="background-color:yellow">Chlorine</span>, 5 reams bondpaper (A4), 2 boxes Paper Clips</a></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
								</tr>
								<tr>
									<td colspan=9"><a href="#">+ More</a></td>
								</tr>
							</tbody>
						</table>
					</div>




					<div id="main-content3" class="hidden">
						Filter:
						<select>
							<option>January</option>
						</select>
						<select>
							<option>2011</option>
						</select>
						until
						<select>
							<option>August</option>
						</select>
						<select>
							<option>2011</option>
						</select>
						<select>
							<option>All Departments</option>
							<optgroup label="Department">
								<option>Liquid Production</option>
								<option>Human Resources</option>
								<option>Fresh Fruit</option>
								<option>Inventory</option>
								<option>Engineering Mech</option>
								<option>Construction</option>
								<option>Junkyard</option>
							</optgroup>
						</select>

						<br /><br />

						<div id="flotPlaceholder" style="width:400px; height:350px;" class="graph"></div>
						<input id="clearSelection" type="button" class="btn" value="Zoom out" style="display:none"/>

						<table id="" class="stylized" style="">
							<thead>
								<tr>

									<th>Month</th>
									<th>Qty</th>
									<th>Cost</th>
									<th>Ave.<br />Turnaround<br />Time</th>

								</tr>
							</thead>
							<tbody>
								<tr>

									<td>January</td>
									<td>50</td>
									<td>2,500</td>
									<td>2 days</td>
								</tr>
								<tr>

									<td>February</td>
									<td>20</td>
									<td>5,000</td>
									<td>7 days</td>
								</tr>
								<tr>

									<td>March</td>
									<td>5</td>
									<td>1,000</td>
									<td>3 days</td>
								</tr>
								<tr>

									<td>April</td>
									<td>100</td>
									<td>10,000</td>
									<td>4 days</td>
								</tr>
								<tr>

									<td>May</td>
									<td>50</td>
									<td>2,500</td>
									<td>3 days</td>
								</tr>
								<tr>

									<td>June</td>
									<td>20</td>
									<td>5,000</td>
									<td>5 days</td>
								</tr>
								<tr>

									<td>July</td>
									<td>5</td>
									<td>1,000</td>
									<td>5 days</td>
								</tr>
								<tr>

									<td>August</td>
									<td>100</td>
									<td>10,000</td>
									<td>3 days</td>
								</tr>
							</tbody>
						</table>


					</div>


					<div id="main-content4" class="hidden">

						<div id="graph-top-suppliers" class="graph"></div>

						<table id="" class="stylized" style="">
							<thead>
								<tr>

									<th>Supplier</th>
									<th>Qty</th>
									<th>Cost</th>
									<th>Ave.<br />Turnaround<br />Time</th>

								</tr>
							</thead>
							<tbody>
								<tr>

									<td>Ace Hardware</td>
									<td>50</td>
									<td>2,500</td>
									<td>3 days</td>
								</tr>
								<tr>

									<td>National Bookstore</td>
									<td>20</td>
									<td>5,000</td>
									<td>4 days</td>
								</tr>
								<tr>

									<td>Worldwide Steel</td>
									<td>5</td>
									<td>1,000</td>
									<td>3 days</td>
								</tr>
								<tr>

									<td>Yutek Corp</td>
									<td>100</td>
									<td>10,000</td>
									<td>7 days</td>
								</tr>
								<tr>

									<td>Mandaue Foam</td>
									<td>50</td>
									<td>2,500</td>
									<td>5 days</td>

								</tr>
								<tr>

									<td>HYMK Steel</td>
									<td>20</td>
									<td>5,000</td>
									<td>2 days</td>
								</tr>
								
							</tbody>
						</table>


					</div>
					
					
					<div id="main-content-search" class="hidden">
						

						Filter:
						<select>
							<option>May</option>
						</select>
						<select>
							<option>2011</option>
						</select>
						<select>
							<option></option>
							<optgroup label="Status">
								<option>Department Manager</option>
								<option>Canvasser</option>
								<option>Purchasing Manager</option>
								<option>Received</option>
							</optgroup>
						</select>
						<input type="text" value="Search..." onclick="this.value=''">

						<table id="report" class="stylized full" style="">
							<thead>
								<tr>

									<th>Requisition #</th>
									<th>Date</th>
									<th>Materials</th>
									<th>Encoder</th>
									<th>Department<br />Manager</th>
									<th>Canvasser</th>
									<th>Purchasing<br />Manager</th>
									<th>Received</th>
									<th>Est.<br />Arrival</th>
								</tr>
							</thead>
							<tbody>
								<tr class="hideable-requisition">

									<td>89273</td>
									<td>2 days ago (May 3)</td>
									<td><a href="<?= base_url() ?>requisitions/new_requisition">1 bottle Chlorine, 5 reams bondpaper (A4), 2 boxes Paper Clips</a></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>12335</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 30, 2011<br />
													<b>Status:</b> Approved by Juan Dela Cruz (Department Manager)
													<ul>
														<li>1 pc T-shirt (green)</li>
														<li>1 pc Clear Folder (short)</li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>5 days ago (April 30)</td>
									<td>1 pc T-shirt (green), 1 pc Clear Folder (short)</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
									<td class="ta-center">2 days from now</td>
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>64563</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals: <a href="#">PO# 123</a></li>
														<li>1pc Extension wire: <a href="#">PO# 456</a></li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>8 days ago (April 27)</td>
									<td>100 pairs Sandals, 1 pc Extension wire</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
									<td class="ta-center">3 days from now</td>
								</tr>
								<tr class="hideable-requisition">

									<td class="title">
										<div>
											<a href="re"><b>97432</b></a>
											<div class="listingDetails">
												<div class="pad">
													<b>Date Requested:</b> April 27, 2011<br />
													<b>Status:</b>
													<ul>
														<li>Approved by Juan Dela Cruz (Department Manager)</a></li>
														<li>Purchased by Jane Santos (Purchasing Manager)</li>
														<li>Received by Jane Santos (Purchasing Manager)</li>
													</ul>
													<b>Materials:</b>
													<ul>
														<li>100 pairs Sandals: <a href="#">PO# 123</a></li>
														<li>1pc Extension wire: <a href="#">PO# 456</a></li>
													</ul>
												</div>
											</div>
										</div>
									</td>
									<td>9 months ago (July 2010)</td>
									<td>Caustic Soda</td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"><img src="<?= $this->config->item('webroot') ?>images/icons/valid.gif" /></td>
									<td class="ta-center"></td>
								</tr>
								<tr class="hidden">

									<td>89273</td>
									<td>2 days ago (May 3)</td>
									<td><a href="<?= base_url() ?>requisitions/new_requisition">1 bottle <span style="background-color:yellow">Chlorine</span>, 5 reams bondpaper (A4), 2 boxes Paper Clips</a></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
									<td class="ta-center"></td>
								</tr>
								<tr>
									<td colspan=9"><a href="#">+ More</a></td>
								</tr>
							</tbody>
						</table>
					</div>
					
					
					

			</div>
						<br /><br /><br />&nbsp;
		</div>
		<!-- End of Wrapper -->
        
	</div>
	<!-- End of Page content -->
    <style>
	div.graph
	{
		width: 400px;
		height: 350px;
		float: left;
		border: 1px dashed gainsboro;
		margin-right:20px;
	}
</style>
<!--[if IE]><script type="text/javascript" src="<?= $this->config->item('webroot') ?>scripts/libraries/flot/excanvas.min.js"></script><![endif]-->
<script type="text/javascript" src="<?= $this->config->item('webroot') ?>scripts/libraries/flot/jquery.flot.min.js"></script>
<script type="text/javascript" src="<?= $this->config->item('webroot') ?>scripts/libraries/flot/jquery.flot.selection.min.js"></script>
<script type="text/javascript" src="<?= $this->config->item('webroot') ?>scripts/libraries/flot/jquery.flot.pie.js"></script>

    <script type="text/javascript" src="<?= $this->config->item('webroot') ?>scripts/application/requisitions.js"></script>
    <script>

	    $('a#for-po-creation').click(function(){
		$('div#main-content2').hide();
		$('div#main-content3').hide();
		$('div#main-content4').hide();
		$('div#main-content-search').hide();
		$('div#main-content1').fadeIn('fast');
		$('span#main-content-box-title').html('For PO Creation');
		return false;
	    });

	    $('a#active-requisitions').click(function(){
		$('div#main-content1').hide();
		$('div#main-content3').hide();
		$('div#main-content4').hide();
		$('div#main-content-search').hide();
		$('div#main-content2').fadeIn('fast');
		$('span#main-content-box-title').html('Active Requisitions');
		return false;
	    });

	    $('a#search').click(function(){
		$('div#main-content1').hide();
		$('div#main-content2').hide();
		$('div#main-content3').hide();
		$('div#main-content4').hide();
		$('div#main-content-search').fadeIn('fast');
		$('span#main-content-box-title').html('Search');
		return false;
	    });

	    
	    $('a#total-requisitions').click(function(){
		$('div#main-content1').hide();
		$('div#main-content2').hide();
		$('div#main-content4').hide();
		$('div#main-content-search').hide();
		$('div#main-content3').fadeIn('fast');
		$('span#main-content-box-title').html('Total Requisitions');


		var fh_data = [

		{
			label: 'Total Requisitions per Month',
			data: [[1293840000 * 1000, 50],[1296518400 * 1000, 20],[1298937600 * 1000, 5],[1301616000 * 1000, 100],[1304208000 * 1000, 50],[1306886400 * 1000, 20],[1309478400 * 1000, 5],[1312156800 * 1000, 100]]
		}
		];
		function weekendAreas(plotarea) {
			var areas = [];
			var d = new Date(plotarea.xmin);
			// go to the first Saturday
			d.setDate(d.getDate() - ((d.getDay() + 1) % 7))
			d.setSeconds(0);
			d.setMinutes(0);
			d.setHours(0);
			var i = d.getTime();
			do {
				areas.push({ x1: i, x2: i + 2 * 24 * 60 * 60 * 1000 });
				i += 7 * 24 * 60 * 60 * 1000;
			} while (i < plotarea.xmax);

			return areas;
		}
		function showTooltip(x, y, contents) {
			$('<div id="hovertip">' + contents + '</div>').css( {
				position: 'absolute',
				display: 'none',
				top: y + 5,
				left: x + 15,
				border: '2px solid #666',
				padding: '4px',
				'background-color': '#fff',
				opacity: 0.9,
				color: '#666',
				fontSize: '13px'
			}).appendTo("body").fadeIn('fast');
		}

		var options = {
			lines: { show: true, lineWidth: 3 },
			points: { show: true },
			legend: { noColumns: 2, position: "se"/*, container: '#flot-legend'*/ },
			yaxis: { min: 0, max: 150 },
			xaxis: { mode: "time", timeformat: "%d %b", monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] },
			selection: { mode: "x" },
			grid: { color: "#666", coloredAreas: weekendAreas, hoverable: true },
			colors: ["#E92424", "#75C5F0"]
		};

		var plot = $.plot($("#flotPlaceholder"), fh_data, options);

		$("#flotPlaceholder").bind("selected", function (event, area) {
			plot = $.plot($("#flotPlaceholder"), fh_data,
				  $.extend(true, {}, options, {
					  xaxis: { min: area.x1, max: area.x2 }
				  }));
			$('#clearSelection').show();
		});
		var previousPoint = null;
		$("#flotPlaceholder").bind("plothover", function (event, pos, item) {
			if (item) {
				if (previousPoint != item.datapoint) {
					previousPoint = item.datapoint;

					$("#hovertip").remove();
					var y = item.datapoint[1];

					showTooltip(item.pageX, item.pageY, y);
				}
			}
			else {
				$("#hovertip").remove();
				previousPoint = null;
			}
		});
		$("#clearSelection").click(function () {
			$.plot($("#flotPlaceholder"), fh_data, options);
			$('#clearSelection').hide();
		});

		return false;
	    });

	    $('a#top-suppliers').click(function(){
		$('div#main-content1').hide();
		$('div#main-content2').hide();
		$('div#main-content3').hide();
		$('div#main-content-search').hide();
		$('div#main-content4').fadeIn('fast');
		$('span#main-content-box-title').html('Top Suppliers');


		var data = [];

		data[0] = { label:'Ace Hardware', data:20 };
		data[1] = { label:'National Bookstore', data:25 };
		data[2] = { label:'Yutek Corp', data:30 };
		data[3] = { label:'Mandaue Foam', data:5 };
		data[4] = { label:'HYMK Steel', data:20 };


		// graph-top-suppliers
		$.plot($("#graph-top-suppliers"), data,
		{
			series: {
				pie: {
					show: true,
					radius:.9,
					label: {
					    show: true,
					    radius: .85,
					    formatter: function(label, series){
						return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'+label+'<br/>'+Math.round(series.percent)+'%</div>';
					    },
					    background: { opacity: 0.8 }
					}
				}
			},
			legend: {
				show: false
			},
			grid: {
				hoverable: true,
				clickable: true
			}
		});
		$("#graph-top-suppliers").bind("plothover", pieHover);
		$("#graph-top-suppliers").bind("plotclick", pieClick);

		function pieHover(event, pos, obj)
		{
			if (!obj)
				return;
			percent = parseFloat(obj.series.percent).toFixed(2);
			$("#hover").html('<span style="font-weight: bold; color: '+obj.series.color+'">'+obj.series.label+' ('+percent+'%)</span>');
		}

		function pieClick(event, pos, obj)
		{
			if (!obj)
				return;
			percent = parseFloat(obj.series.percent).toFixed(2);
			alert(''+obj.series.label+': '+percent+'%');
		}



		return false;
	    });


	    
	    $('#main-content-search input[type=text]').keyup(function(){

			if ($(this).val()=='') {
				$('#main-content-search .initially-hidden').addClass('hidden');
				$('#main-content-search .initially-hidden').removeClass('initially-hidden');
				$('#main-content-search .hideable-requisition').removeClass('hidden');
			} else {
				$('#main-content-search .hidden').addClass('initially-hidden');
				$('#main-content-search .hidden').removeClass('hidden');
				$('#main-content-search .hideable-requisition').addClass('hidden');
			}
		});



    </script>
